"use strict";

/**
 * @param {Egg.Application} app - egg application
 */

  const obs = require("node-media-server");
module.exports = (app) => {
  const { router, controller } = app;

  const newObs = new obs(app.config.mediaServer)

  newObs.run()

  //登录
  router.post("/api/login", controller.login.login);
  // 第三方登录
  router.post("/api/giteeLogin", controller.login.giteeLogin);
  //注册
  router.post("/api/register", controller.login.register);
  //用户
  router.get("/api/getuserinfo", controller.login.getUserInfo);

   // 图片上传
   router.post("/api/upload", controller.upload.imgUpLoad);

  //房源列表
  router.post("/api/getHousingList", controller.housing.index);
  //房源删除
  router.post("/api/housingDelete", controller.housing.delete);
  //添加房源
  router.post("/api/housingadd", controller.housing.housingadd);

  //团购列表
  router.post("/api/getGroupList", controller.group.index);
  //团购删除
  router.post("/api/groupDelete", controller.group.delete);

  //订单列表
  router.post("/api/getOrderList", controller.order.index);
  //订单删除
  router.post("/api/orderDelete", controller.order.delete);

  //经纪人列表
  router.post("/api/getBrokerList", controller.broker.index);
  //经纪人删除
  router.post("/api/brokerDelete", controller.broker.delete);
  

  //咨询列表
  router.post("/api/getConsultList", controller.consult.index);
  //咨询删除
  router.post("/api/consultDelete", controller.consult.delete);
  //添加
  router.post("/api/consultadd", controller.consult.consultadd);

  //直播列表
  router.post("/api/getLiveList", controller.live.index);
  //直播删除
  router.post("/api/liveDelete", controller.live.delete);
};
